package com.stud.system.service;

import com.stud.common.enums.BusinessEnum;
import com.stud.common.mybatis.BaseService;
import com.stud.system.domain.FileLink;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * 系统文件关联Service接口
 *
 * @author Stud
 * @date 2022-10-08
 */
public interface FileLinkService extends BaseService<FileLink> {

    FileLink upload(BusinessEnum businessEnum, MultipartFile file);

    FileLink link(Long id, Long businessId);

    List<FileLink> linkBatch(Long[] ids, Long businessId);

    FileLink uploadLink(BusinessEnum businessEnum, Long businessId, MultipartFile file);

    List<FileLink> uploadLink(BusinessEnum businessEnum, Long businessId, MultipartFile[] files);

    Map<Long, List<FileLink>> linkMap(BusinessEnum businessEnum, List<Long> businessIds);

    Map<Long, List<Long>> linkIdMap(BusinessEnum businessEnum, List<Long> businessIds);

    boolean deletePhysical(Long[] ids);

    boolean deletePhysical(List<FileLink> list);

    boolean fileReport(String fileName, MultipartFile file);

    FileLink getLinkByFileKey(String fileKey);

    String getDownloadUrl(String fileKey);
}
